import React from 'react';
import { Layout,Menu } from 'antd';
import {withRouter} from 'react-router-dom'
import './index.css'

const{Sider:AntSider} = Layout;
function Side(props) {

    const {history} = props;
    const handleMenuClick=(e)=>{
        if(e.key==='home'){
            history.push(`/`)
        }else {
            history.push(`/${e.key}`)
        }

    }
  return (
    <AntSider>
      <div className="sider-logo">
        <svg  viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M938.496 294.912c-165.376-227.84-314.88-104.448-314.88-104.448l-133.12-90.624s-62.464-12.288-88.064 120.832C380.928 329.216 460.8 390.144 460.8 390.144l40.448-51.712c40.448-51.712 77.312-40.448 77.312-40.448-51.712 99.328-145.92 261.632-154.624 280.576l-12.288 23.552 10.752 26.624c13.824 25.6 25.6 53.248 35.328 81.408 10.752-47.616 12.288-83.456 3.072-99.84 4.608-1.024 8.704-1.024 11.776 1.024 22.016 10.24 18.944 65.536-3.072 140.8 8.704 38.4 13.312 78.336 12.288 119.296-1.024 32.768 2.56 33.792-4.096 65.024 48.64-112.64 61.44-178.688 43.52-208.384 4.608-1.024 8.704-1.024 11.776 1.024 34.304 16.384 46.08 39.936-20.992 181.76-10.24 20.992-5.632 20.48-15.872 38.912l286.72 3.072c77.312-151.552 68.608-151.552 76.288-223.232 8.704-88.064-125.952-320-92.16-378.88 31.744-59.392 171.52-55.808 171.52-55.808z m-209.408-31.744c-10.24-6.144-17.92-14.848-22.016-23.552l48.64-5.632c2.56 1.024 4.608 2.56 7.168 4.096 10.24 6.144 17.92 14.848 22.016 23.552-13.312 12.288-36.352 13.312-55.808 1.536z" p-id="3406" fill="#2585a8"></path><path d="M428.032 629.248c-1.536-4.096-4.096-7.68-5.632-11.776v11.776c13.824 25.6 25.6 53.248 35.328 81.408-8.192-28.16-18.432-55.296-29.696-81.408zM280.064 526.336c-55.296 84.992-64 196.608-12.288 291.84 34.304 63.488 89.088 107.52 150.528 131.072 46.08-89.088 48.64-197.632-3.072-291.84-31.744-59.392-79.36-103.936-135.168-131.072zM368.64 816.64c-25.6-9.216-49.152-28.672-63.488-55.296-22.016-39.936-17.92-86.528 5.632-122.368 23.552 11.776 43.52 30.208 56.832 55.296 20.992 39.936 19.456 86.016 1.024 122.368zM114.688 484.864c-32.256 44.544-38.912 104.448-13.824 157.184 17.408 35.328 45.056 59.904 78.336 74.24 26.624-47.104 30.208-105.472 5.632-157.696-16.384-32.256-41.472-57.344-70.144-73.728z m40.448 159.232c-13.824-5.632-25.6-16.384-32.768-31.232-10.752-22.016-7.68-47.616 5.632-66.56 12.288 7.168 22.528 17.408 29.696 31.232 10.24 22.016 8.704 47.104-2.56 66.56zM321.024 348.16c-46.08 7.68-86.016 39.936-101.376 86.528-10.24 31.232-8.704 63.488 3.072 91.136 43.52-12.288 81.408-45.056 96.768-92.16 9.216-28.672 9.216-58.368 1.536-85.504zM250.368 468.48c-4.608-11.776-5.632-25.088-1.536-38.4 7.168-19.456 23.552-32.768 43.008-36.864 3.072 11.776 3.072 24.064-1.024 35.84-6.144 19.968-21.504 33.792-40.448 39.424z" p-id="3407" fill="#2585a8"></path></svg>管理端
      </div>
      <Menu onClick={(e)=>{handleMenuClick(e)}}  theme="dark" defaultSelectedKeys={['1']} mode="inline">
            <Menu.Item key="home">
              首页
            </Menu.Item>
            <Menu.Item key="article">
              文章
            </Menu.Item>
            <Menu.Item key="message">
              留言
            </Menu.Item>
            <Menu.Item key="about">
              关于
            </Menu.Item>
            <Menu.Item key="config">
              博客端配置
            </Menu.Item>
        </Menu>
    </AntSider>
  )
}

export default withRouter(Side)
